const { defineComponent,h} = require("vue");
import {PullRefresh,Loading} from "vant"

const Pulls= defineComponent({
    data(){
        return{

        }
    },
    props:{
        load:{
            type:Function,
            required:false
        },
        refresh:{
            type:Function,
            required:false
        },
        Listarrts:{
            type:Object,
            required:false
        },
        minHeight:{
            type:String,
            required:false
        }
    },
    emits:['update:Listarrts'],
    setup(props, { attrs,slots,emit,watch }){
        const pullingLoading = () => {
            return h(Loading,{color:'#3D39D8'},null)
        }
        return ()  => h(
            PullRefresh,
            {   
                style:{
                    minHeight:props.minHeight?props.minHeight:'calc(100vh - 120px)'
                },
                modelValue:props.Listarrts.refreshing,
                onRefresh:props.refresh,
                'onUpdate:modelValue':($event)=>emit('update:Listarrts',{refreshing:$event})
            },
            {
                default:() =>h(
                    'div',
                    {},
                    [
                        slots.lists?slots.lists(props.Listarrts):null
                    ]
                ),
                pulling:pullingLoading,
                loading:pullingLoading
            }
        )
    }
})

export default Pulls